where
EventRecord structure
#include <Events.h>
typedef struct EventRecord { Size Offset Description
short what; 2 0 Type of event (0=nothing) (for
more information, see Event Types)
long message; 4 2 Varies per event type (see Notes)
long when; 4 6 Timestamp (ticks since system
startup)
Point where; 4 10 Mouse position, in global coordinates
short modifiers; 2 14 State of shift, cmd, option, ctrl keys
et al.
Note: No typedef exists for an (EventRecord *)

Notes: The contents of the message field varies, depending upon the type of event
(found in the what field), as follows:
Event Type Contents of EventRecord. message
nullEvent (un defined)
keyDown bits 0-7=char; bits 8-15=key code (see GetNextEvent)
keyUp (same)
mouseDown (un defined) Note: mouse position is in the where field
mouseUp (un defined)
updateEvt WindowPtr; identifies relevant window
activateEvt (same) Note: bit 0 of modifiers indicates
activate/deactivate
diskEvt bits 0-15= drive; bits 16-31=error (see DIBadMount)
driverEvt defined by driver
app1Evt application- defined (see PostEvent)
app2Evt (same)
app3Evt (same)
app4Evt (used by MultiFinder for suspend/resume and mouse-move events)
The modifiers field is a set of bit flags having the following layout. Named
constants are defined in EventMgr.h:
Macintosh documentation does not provide a standard name for a pointer to
an EventRecord structure. Since passing such a pointer is a common
operation, you might wish to use:
typedef EventRecord * EventPtr ;